﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="create_File.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Gallery.create_File" %>

<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <%
        var get_last = new TblLibraryController().FetchAll().Last();
        var get_uploader = new TblManagerController().FetchAll().Where(x => x.ManagerId == get_last.LibraryUploader).Single();
        var get_editor = new TblManagerController().FetchAll().Where(x => x.ManagerId == get_last.LibraryEditor).Single();
        string upload_date = "", edit_date = "";
        DateTime date = DateTime.Parse(get_last.LibraryUploadDate.ToString());
        upload_date = date.Day + "/" + date.Month + "/" + date.Year + " " + date.Hour + ":" + date.Minute;
        date = DateTime.Parse(get_last.LibraryEditDate.ToString());
        edit_date = date.Day + "/" + date.Month + "/" + date.Year + " " + date.Hour + ":" + date.Minute;
        if (get_last.LibraryType == 1)
        {
    %>
    <tr id="item<%=get_last.LibraryId %>">
        <td class="gal-table-name">
            <img src="../Content/testdata/picture/<%=get_last.LibraryLink %>" alt="[img not found!]" onclick="gal_view_img(this,'<%=get_last.LibraryName %>')" title="Xem ảnh" data-toggle="tooltip" data-placement="bottom" />
            <span><span class="item_name"><%=get_last.LibraryName %></span></span></td>
        <td class="gal-table-date"><span title="<%=get_uploader.FullName %>" data-toggle="tooltip" data-placement="bottom"><%=upload_date %></span></td>
        <td class="gal-table-modified"><span title="<%=get_editor.FullName %>" data-toggle="tooltip" data-placement="bottom"><%=edit_date %></span></td>
        <td class="gal-table-options">
            <input class="gal-link-copy" id="link<%=get_last.LibraryId %>" value="../Content/testdata/picture/<%=get_last.LibraryLink %>" />
            <i onclick="gal_copy(<%=get_last.LibraryId %>)" title="Sao chép link" data-toggle="tooltip" data-placement="bottom" class="fa fa-copy w3-hover-text-teal"></i>
            <i onclick="gal_rename('<%=get_last.LibraryName %>','<%=get_last.LibraryId %>')" title="Đổi tên" data-toggle="tooltip" data-placement="bottom" class="fa fa-edit w3-hover-text-teal"></i>
            <i onclick="gal_move('<%=get_last.LibraryId %>')" title="Di chuyển" data-toggle="tooltip" data-placement="bottom" class="fa fa-external-link w3-hover-text-teal"></i>
            <i onclick="gal_delete(<%=get_last.LibraryId %>)" title="Xóa" data-toggle="tooltip" data-placement="bottom" class="fa fa-trash w3-hover-text-teal"></i>
        </td>
    </tr>
    <%
        }
        if (get_last.LibraryType == 2)
        {
    %>
    <tr id="item<%=get_last.LibraryId %>">
        <td class="gal-table-name"><i onclick="gal_play_audio(event,'<%=get_last.LibraryLink %>')" title="Phát âm thanh" data-toggle="tooltip" data-placement="bottom" class="gal-play-audio-btn fa fa-volume-up w3-hover-text-teal"></i><i onclick="gal_stop_audio(event)" title="Dừng" data-toggle="tooltip" data-placement="bottom" class="gal-stop-audio-btn fa fa-pause w3-hover-text-teal"></i><span class="item_name"><%=get_last.LibraryName %></span></td>
        <td class="gal-table-date"><span title="<%=get_uploader.FullName %>" data-toggle="tooltip" data-placement="bottom"><%=upload_date %></span></td>
        <td class="gal-table-modified"><span title="<%=get_editor.FullName %>" data-toggle="tooltip" data-placement="bottom"><%=edit_date %></span></td>
        <td class="gal-table-options">
            <input class="gal-link-copy" id="link<%=get_last.LibraryId %>" value="../Content/testdata/audio/<%=get_last.LibraryLink %>" />
            <i onclick="gal_copy(<%=get_last.LibraryId %>)" title="Sao chép link" data-toggle="tooltip" data-placement="bottom" class="fa fa-copy w3-hover-text-teal"></i>
            <i onclick="gal_rename('<%=get_last.LibraryName %>','<%=get_last.LibraryId %>')" title="Đổi tên" data-toggle="tooltip" data-placement="bottom" class="fa fa-edit w3-hover-text-teal"></i>
            <i onclick="gal_move('<%=get_last.LibraryId %>')" title="Di chuyển" data-toggle="tooltip" data-placement="bottom" class="fa fa-external-link w3-hover-text-teal"></i>
            <i onclick="gal_delete(<%=get_last.LibraryId %>)" title="Xóa" data-toggle="tooltip" data-placement="bottom" class="fa fa-trash w3-hover-text-teal"></i>
        </td>
    </tr>
    <%
        }
    %>
</body>
</html>
